package com.tmt.im.common.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.tmt.im.common.annotation._AllowUpdate;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
import org.apache.ignite.cache.query.annotations.QuerySqlField;

import java.io.Serial;
import java.sql.Timestamp;

/**
 * @Description TODO
 * @Author wuyi
 * @Date 2024/9/29 18:24
 * @Version 1.0
 **/
@Getter
@Setter
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
public class SystemNotifyPoJo implements IGetKey<SystemNotifyKey> {

    @Serial
    private static final long serialVersionUID = -5297812138551105117L;

    public static final String CACHE_NAME = "system_notify";

    @QuerySqlField(name = "id", index = true)
    private Long id;

    @QuerySqlField(name = "id", index = true)
    private Long mid;

    @QuerySqlField(name = "title")
    @_AllowUpdate
    private String title;

    @QuerySqlField(name = "content")
    @_AllowUpdate
    private String content;

    @QuerySqlField(name = "type")
    @_AllowUpdate
    private String type;

    @QuerySqlField(name = "update_time")
    @_AllowUpdate
    private Timestamp updateTime;

    @QuerySqlField(name = "version")
    @_AllowUpdate
    private Long version;

    @QuerySqlField(name = "create_time")
    private Timestamp createTime;

    @QuerySqlField(name = "creator_id")
    private Long creatorId;

    @JsonIgnore
    private boolean insert;

    @Override
    public SystemNotifyKey getKey() {
        return new SystemNotifyKey(id, creatorId);
    }

}